home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Almathera Ten Pack 2: CDPD 1
/
Almathera Ten on Ten - Disc 2: CDPD 1.iso
/
pd
/
301-325
/
311
/
echo
/
echo.doc
< prev
next >
Wrap
Text File
|
1995-03-14
|
7KB
|
189 lines
Program: echo
Programmer: George Kerber
Written: 08/26/89 - 09/13/89
Version: 1.07
Application: AmigaDOS
Purpose: Echo is an AmigaDOS replacement that will emulate the AmigaDOS
echo, yet provide many options and versatility.
SYNTAX: echo [-options] ["quoted string"] [NOLINE]
OPTIONS: (for non-programmers "|" means "or")
? A help screen will be displayed.
-a n,n... Change attributes, where "n" is one or more of the values
specified below separated by commas.
_______________________________________________________________________
These options are used as co-options to -a or escape characters
which are described below.
0 Text, color 0, default is blue.
1 Text, color 1, default is white.
2 Text, color 2, default is black.
3 Text, color 3, default is orange
D|4 Reset all attributes to default preference settings.
B|5 Text, bold face.
U|6 Text, underline.
I|7 Text, italics.
) Background, color 0. (Shift 0) Don't try to remember the
! Background, color 1. (Shift 1) actual character, just
@ Background, color 2. (Shift 2) remember <shift> color #
# Background, color 3. (Shift 3) for background color changes.
_______________________________________________________________________
-c Clear screen.
-e Clear from cursor to bottom of the screen.
-k Do not reset attributes set by echo options to default.
(Normally, all attributes are set to default when echo exits)
-n Same as NOLINE as the last option after the string, doesn't do a
newline after printing string. NOLINE is provided for
compatibility with the AmigaDOS echo. NOLINE & -n do the same
thing.
-z Will automatically set the -n (NOLINE) option and will supress
the visable cursor at the end of the "echoed" string.
This is useful only if no other echo lines will be displayed
before the next clear screen.
-x Center string on screen. This option is incompatable with -m
or -p unless x = 0.
-m n Begin printing string at "n" character position on the current
line. (0-77) Can't be used with -x.
-u|d n Move cursor up|down "n" lines.
-h|r n Scroll screen up|down "n" lines.
-p x,y Place cursor at position x,y, where,
x = character position (0-77) & y = line (1-23).
If used with -x, then x (char position) must be 0.
VALID ESCAPE VALUES: (lower case only)
n Creates a newline
t Adds a tab
b Backspace
q Prints a quote (")
$ Only necessary if the first character of the string is a '-'.
Plus, all characters listed above for the -a option can be used. Like
the color options. See the examples below.
AmigaDOS defaults to a '*' as the escape character for echo. You can change
this if you like by using the AmigaDOS 1.3 command 'setenv'. This function
retains compatibility with the ARP echo command.
1> setenv ESCAPE "\" ;or whatever you want.
1>
If ESCAPE is set to more than one character, echo will use the first
character. To actually print a literal escape character you must enter it
twice to print it once.
1> echo "example to print two **** stars ****"
example to print two ** stars **
1>
INSTALLATION: Replace the existing AmigaDOS echo command in your c:
directory with this new echo command.
1> copy echo c:
1>
A WORD ABOUT QUOTING: Unlike the AmigaDOS echo, you don't have to quote the
string as long as there are no spaces in the string. I would suggest
quoting all strings as a matter of habit. To actually print a quote in your
string, you must escape a 'q'.
1> echo " the word *qquote*q is quoted "
the word "quote" is quoted
1>
PROGRAM OPERATION: Any -options given on the command line are performed
before any escape characters in the string are evaluated. So any position,
or color, etc. -options are executed before the input string is ever looked
at. Any escape options given in the input string are done in the order they
are entered. This can be important to give options in the proper order and to
know when to use a -option or an escape option to achieve the desired
result. You may have to experiment. Check out the echo.examples script
for some help in this area. Most of the time, there is no problem using
either the -options or escape options in any order. But, consider this
line:
1> echo -d 5 -a 5,3,@ -c "testing the -c option"
First the cursor is moved down 5 lines, then the text attributes are set
to bold, orange and black background, and THEN THE SCREEN IS CLEARED!
See the trouble? Always clear the screen first.
Escape options are used in the actual input string to be printed, but the
escape character and escape option are not printed, just the text.
<newline><newline><tab>example <quote>line<quote><newline><newline>
1> echo "*n*n*texample *qline*q*n*n"
example "line"
1>
There are sometimes more than one way to do the same thing. The following
three lines will do the exact same thing.
1> echo -a 3,5,@ "bolded, orange with black background"
1> echo "*3*5*@bolded, orange with black background"
1> echo "^[[33m^[[1m^[[42mbolded, orange with black background"
Actually the second and third example are exactly the same as to the string
that is printed to the screen. But the codes shown are hard to remember, so
I recommend using the numeric codes as shown in the first and second example.
As you can see, the escape values can change attributes too. This can be
very useful to print text of more than one attribute in the same line.
1> echo "*3orange, *5orange bolded, *4*2black, *4reset"
Note that the blank space between the -options and the argument to that
option is optional. The following two lines are identical.
1> echo -c -p 10,14 -d5 "test string"
1> echo -c -p10,14 -d 5 "test string"
Echo will interpert any option starting with a '-' as an option even if you
have the string quoted. This will still clear the screen:
1> echo "-c"
And this will cause an "Invalid Option" error:
1> echo "-s" (since 's' is not a valid option)
To actually print a '-' dash at the beginning of a string, it must be escaped
using the '$' escape value.
1> echo "*$-c"
-c
1>
MORE EXAMPLES: Execute the echo.examples file, then see how it was done.
CREDITS: See the echo.credits file.
STATUS: This is public domain, but please keep me as author and keep all
the documentation intact. Anyway, if something is wrong with this program,
I'm not responsible.....
George Kerber
19756 E. Linvale Drive
Aurora, Colorado 80013
(303) 693-2890
Compuserve: 74010.2132